<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <title> New Document </title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <link rel="stylesheet" href="/common/js/datepicker/css/smoothness/jquery-ui-1.9.2.custom.min.css"/>
 
<script type="text/javascript" src="/common/js/jquery-1.11.0.js"></script>
<script type="text/javascript" src="/common/js/common.js"></script>
<script type="text/javascript" src="/common/js/serviceCall.js"></script>
<script type="text/javascript" src="/common/js/datepicker/jquery-ui-1.9.2.custom.js"></script>
<script type="text/javascript" src="/common/js/datepicker/datepicker.config.js"></script>
<script type="text/javascript" src="/common/js/date.js"></script>
<script type="text/javascript" src="/common/js/json.js"></script>
<script type="text/javascript" src="/common/js/editor/js/HuskyEZCreator.js" charset="utf-8"></script>
<script type="text/javascript" src="/common/js/editorCaller.js"></script>
<script type="text/javascript">
var popup = new NormalServiceCaller("SVC0009");
var insertPopup = new NormalServiceCaller("SVC0010");
var oEditors = [];
var option = {
		"elPlaceHolder" : "ir1",
		"textAreaEl" : "contents",
		"serverContents" : '서버에서 온 내용'
};

function fn_view(){
	var param = {};
	param.pNo = PARAM.pNo;
	popup.processSvc(function(data){
		var data = data.data;

		$.each(data, function(k, v){
			$("[name="+k+"]").val(v);
		});

		option.serverContents = decodeHTMLEntities(data.contents);
		EDITOR_CALLER.init(option);
	},param);
}

function fn_insertPopup(){
	
	$("#contents").val(EDITOR_CALLER.getEditorContentHTML());
	var param = $("#frm").serialize();
	insertPopup.processSvc(function(){
	
	},param);
}

$(function(){
	fn_view();
	$("#submitBtn").click(function(e){
		e.preventDefault();
		fn_insertPopup();
	});
});

</script>
</head>
<body>
<form name="frm" id="frm" method="post">
<input type="hidden" name="pNo" id="pNo"/>
<table border="1" width="100%">
<tr>
	<td>제목</td>
	<td><input type="text" name="subject"/></td>
</tr>
<tr>
	<td>width</td>
	<td><input type="text" name="width"/>px</td>
</tr>
<tr>
	<td>height</td>
	<td><input type="text" name="height"/>px</td>
</tr>
<tr>
	<td>marginLeft</td>
	<td><input type="text" name="marginLeft"/>px</td>
</tr>
<tr>
	<td>marginTop</td>
	<td><input type="text" name="marginTop"/>px</td>
</tr>
<tr>
	<td>사용유무</td>
	<td>
		<select name="useYn">
			<option value="Y">Y</option>
			<option value="N">N</option>
		</select>
	</td>
</tr>
<tr>
	<td>사용유무</td>
	<td>
		<textarea name="ir1" id="ir1" rows="10" cols="100" style="width:766px; height:412px; display:none;"></textarea>
		<textarea name="contents" id="contents" rows="10" cols="100" style="width:100%; height:412px; min-width:610px; display:none;"></textarea>	
	</td>
</tr>
<tr>
	<td>
		<button id="submitBtn"> 저장</button>
	</td>
</tr>
</table>

</form>
</body>
</html>
